package com.iqiyi.pps.epg.core.model.push;

import com.iqiyi.kiwi.utils.Configuration;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by zhang on 2016/1/27.
 */
@Entity
@Table(name = "auto_push_msg")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class AutoPushMsg {

    public static final Integer AUTO_PUSH_TYPE_ANDRIOD = 21;
    public static final Integer AUTO_PUSH_TYPE_IOS = 20;

    public static final Integer AUTO_PUSH_STATUS_DEL = -1;
    public static final Integer AUTO_PUSH_STATUS_WAIT = 0;
    public static final Integer AUTO_PUSH_STATUS_PUSHING = 1;
    public static final Integer AUTO_PUSH_STATUS_SUCCESS = 2;
    public static final Integer AUTO_PUSH_STATUS_FAIL = 3;
    public static final Integer AUTO_PUSH_STATUS_OFFLINE = 4;

    public static final Integer AGENT_TYPE_EPG = 153;
    public static final Integer MSG_TYPE_EPG = 53;
    public static final Integer DURATION = 30 * 60;

    public static final Integer ANDRIOD_PUSH_TIME = Configuration.getInteger("andriod.push.time", 10 * 60 * 1000);   //安卓推送时间
    public static final Integer IOS_PUSH_TIME = Configuration.getInteger("ios.push.time", 5 * 60 * 1000);      //苹果推送时间

    private long id;
    private long episodeId;
    private String deviceId;
    private int passportAgentType;
    private int epgPlayPlatform;
    private int appId;
    private String appVer;
    private int agentType;
    private int platformType;
    private String msgId;
    private int msgType;
    private int duration;
    private String msgTitle;
    private String msgContent;
    private String msgUrl;
    private String msgAlertBody;
    private String msgExt;
    private int priority;
    private String sign;
    private Timestamp pushTime;
    private int pushStatus;
    private String pushResponse;
    private Timestamp pushFinishTime;
    private Timestamp createdTime =  new Timestamp(System.currentTimeMillis());

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name = "episode_id")
    public long getEpisodeId() {
        return episodeId;
    }

    public void setEpisodeId(long episodeId) {
        this.episodeId = episodeId;
    }

    @Column(name = "app_id")
    public int getAppId() {
        return appId;
    }

    public void setAppId(int appId) {
        this.appId = appId;
    }

    @Column(name = "app_ver")
    public String getAppVer() {
        return appVer;
    }

    public void setAppVer(String appVer) {
        this.appVer = appVer;
    }

    @Column(name = "agent_type")
    public int getAgentType() {
        return agentType;
    }

    public void setAgentType(int agentType) {
        this.agentType = agentType;
    }

    @Column(name = "platform_type")
    public int getPlatformType() {
        return platformType;
    }

    public void setPlatformType(int platformType) {
        this.platformType = platformType;
    }

    @Column(name = "msg_id")
    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    @Column(name = "msg_type")
    public int getMsgType() {
        return msgType;
    }

    public void setMsgType(int msgType) {
        this.msgType = msgType;
    }

    @Column(name = "duration")
    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    @Column(name = "msg_title")
    public String getMsgTitle() {
        return msgTitle;
    }

    public void setMsgTitle(String msgTitle) {
        this.msgTitle = msgTitle;
    }

    @Column(name = "msg_content")
    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    @Column(name = "msg_url")
    public String getMsgUrl() {
        return msgUrl;
    }

    public void setMsgUrl(String msgUrl) {
        this.msgUrl = msgUrl;
    }

    @Column(name = "msg_alert_body")
    public String getMsgAlertBody() {
        return msgAlertBody;
    }

    public void setMsgAlertBody(String msgAlertBody) {
        this.msgAlertBody = msgAlertBody;
    }

    @Column(name = "msg_ext")
    public String getMsgExt() {
        return msgExt;
    }

    public void setMsgExt(String msgExt) {
        this.msgExt = msgExt;
    }

    @Column(name = "priority")
    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    @Column(name = "sign")
    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Column(name = "created_time")
    public Timestamp getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Timestamp createdTime) {
        this.createdTime = createdTime;
    }

    @Column(name = "device_id")
    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    @Column(name = "passport_agent_type")
    public int getPassportAgentType() {
        return passportAgentType;
    }

    public void setPassportAgentType(int passportAgentType) {
        this.passportAgentType = passportAgentType;
    }

    @Column(name = "epg_play_platform")
    public int getEpgPlayPlatform() {
        return epgPlayPlatform;
    }

    public void setEpgPlayPlatform(int epgPlayPlatform) {
        this.epgPlayPlatform = epgPlayPlatform;
    }

    @Column(name = "push_time")
    public Timestamp getPushTime() {
        return pushTime;
    }

    public void setPushTime(Timestamp pushTime) {
        this.pushTime = pushTime;
    }

    @Column(name = "push_status")
    public int getPushStatus() {
        return pushStatus;
    }

    public void setPushStatus(int pushStatus) {
        this.pushStatus = pushStatus;
    }

    @Column(name = "push_response")
    public String getPushResponse() {
        return pushResponse;
    }

    public void setPushResponse(String pushResponse) {
        this.pushResponse = pushResponse;
    }

    @Column(name = "push_finish_time")
    public Timestamp getPushFinishTime() {
        return pushFinishTime;
    }

    public void setPushFinishTime(Timestamp pushFinishTime) {
        this.pushFinishTime = pushFinishTime;
    }
}
